'''
- 将上述的CRUD操作都举例重复一遍.
- 自己做一张4X4的表格, 表示当前接口是否可用.
'''

#(1) CRUD 操作
# list 增加

list1 = ['2','3']
list1.append(1)

print(list1)

#list 索引
first = list1[0]
print(first)

#list 切片
part_list1 = list1[1:2]
print(part_list1)

#list更新
list2 = ['a','b','c','d','e','f']
list2[2]= '111'
print(list2)

#list删除
a = ['1','2','3','4','5']
del a[4]
print(a)

b=[1,2,9]
b.remove(9)
print(b)

c = [1,2,3,5,7,9]
c.pop()
print(c)

#tuple 索引
tup = (1,2,3,4,'cat')
print(tup[3])

#dict 的增加
my_dict = dict()
my_dict['name'] = 'cade'
my_dict['job'] = 'PM'
print(my_dict)

#dict 的索引
name = my_dict.get('name')
age = my_dict.get('age')

print(name,age)

#dict 的修改
my_dict.update({'name':'feifeiyang','age':'18'})
print(my_dict)

#dict 的删除
age_value = my_dict.pop('age')
print(age_value)
print(my_dict)

item = my_dict.popitem()
print(item)
print(my_dict)

# set 的增加
my_set = {1,2,'apple','oppo','xiaomi'}
my_set.add('vivo')
print(my_set)

#set 不支持索引  支持 in操作，即判断元素在set中是否存在
xiaomi_is_exist = 'xiaomi' in my_set
print(xiaomi_is_exist)

one_plus_is_exist = 'one_plus' in my_set
print(one_plus_is_exist)


#set 的更新
my_set.add(999)
print(my_set)


#set 的删除
my_set.remove(2)
print(my_set)

"""
|type|  增加    |    检索    |     更新   |     删除   |

|list|    √     |    √       |    √     |     √       |   
|tuple|   ×     |    √       |    ×      |    ×      |
|dict|    √     |    √       |    √     |    √        |
|set|      √    |    ×       |    √     |    √       |


"""
